//<template>
  <div>
      <h3>分类添加</h3>
      <p>分类名：<input type="text" v-model="name"></p>
      <p><input type="button" value="添加" @click="add()"></p>
  </div>
</template>

<script>
import axios from 'axios'
export default {
    name:'cateadd',
    data(){
      return{
        name:''
      }
    },
    methods:{
      add(){
        var form_data = new FormData()
        form_data.append('name',this.name)
        axios({
          url:'http://127.0.0.1:8000/app03/cateadd/',
          method:'post',
          data:form_data
        }).then(res=>{
          console.log(res)
        })
      }
    }

}
</script>

<style>

</style>
